package  
{
	import flash.display.MovieClip;
	import flash.display.SimpleButton;
	import flash.events.MouseEvent;
	/**
	 * ...
	 * @author Seven Gae
	 */
	public class GameOver extends Level_Base 
	{
		private var background: FlashingBackground;
		private var tryAgain: SimpleButton;
		
		public override function start():void
		{	
			background = new FlashingBackground();
			tryAgain = new TryAgain();
			tryAgain.x = Main.Self.stage.stageWidth / 2;
			tryAgain.y = Main.Self.stage.stageHeight / 2;
			Main.Self.screen.addChild(tryAgain);
			tryAgain.addEventListener(MouseEvent.CLICK, handleTryAgain);
			SoundManager.playSound("perdeu");
		}
		
		public function handleTryAgain(Evento:MouseEvent):void
		{
			tryAgain.removeEventListener(MouseEvent.CLICK, handleTryAgain);
			Main.Self.screen.removeChild(tryAgain);
			LevelManager.current = new Level1();
			
		}
		
		public override function update():void
		{	
			background.update();
		}
		
		public override function terminate():void
		{
			background.destroy();
		}
		
	}

}